package com.billiards.controller;

import com.billiards.entity.BallAppt;
import com.billiards.entity.Leaves;
import com.billiards.service.LeavesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class LeavesController {
    @Autowired
    public LeavesService leavesService;

    @RequestMapping("/getLeavesList")
    public List<Leaves> getLeavesList(){
        return leavesService.getLeavesList();
    }



    @PostMapping("/addLeaves")
    public int addLeaves(@RequestBody Leaves leaves){

        System.out.println("===========");
        System.out.println(leaves);
        return leavesService.addLeaves(leaves);
    }
}
